home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 10 code / Picture Utilities / sample utilities.h < prev   
Encoding:
C/C++ Source or Header  |  1992-04-08  |  2.1 KB  |  67 lines  |  [TEXT/KAHL]

  1.  
  2. #pragma once
  3.  
  4.  
  5. #define    IfDebug(x, y)            { if(x) DebugStr(y); }
  6. #define    offsetField(type, field)        ((long) &((type *) 0)->field)
  7. #undef    nil
  8. #define    nil    0
  9.  
  10.  
  11. typedef struct diskPictureRecord {
  12.     long            owners;
  13.     PicHandle        picture;
  14.     CQDProcs        procs;
  15.     Rect            bounds;
  16.     PicHandle        cachedPicture;        /* if we have enough memory, this will be a purgable copy of the entire picture */
  17.     Handle        bufferRef;            /* reference for the buffer for reading picture bytes from disk */
  18.     char            *bufferStart;        /* pointer to the start of this buffer (only valid while picture is installed) */
  19.     long            bufferSize;        /* size of this buffer (only valid while picture is installed) */
  20.     char            *bufferPtr;        /* pointer to the next byte to read from this buffer (only valid while picture is installed) */
  21.     short        file;
  22.     short        padding;            /* long align the following fields */
  23.     CGrafPtr        installedPort;        /* this is the port that this disk picture is currently installed into */
  24.     CQDProcsPtr    savedProcs;        /* this field is used to save the original value of the graf port’s saved proc pointer */
  25. } diskPictureRecord;
  26. typedef diskPictureRecord **diskPicture;
  27.  
  28.  
  29. typedef enum screenTypes {
  30.     screen1Bit        = 1,
  31.     screen2Bit,
  32.     screen4Bit,
  33.     screen8Bit,
  34.     screen16Bit,
  35.     screen32Bit,
  36.     screenColor        = 0x100,
  37.     screenMonoChrome    = 0x200
  38. } screenTypes;
  39. typedef long screenType;
  40.  
  41.  
  42. typedef enum bufferTypes {
  43.     bufferExactSize,
  44.     bufferCanBeSmaller
  45. } bufferTypes;
  46. typedef long bufferType;
  47.  
  48.  
  49. #define    disk_picture_already_installed        -100000L
  50. #define    disk_picture_not_installed        -100001L
  51.  
  52.  
  53. void FindScreen(screenType type, short hSize, short vSize, Rect *bounds);
  54. void PostError(long error);
  55. void *GetBuffer(Handle *referencePtr, long *sizePtr, bufferType type);
  56.  
  57. diskPicture NewDiskPicture(FSSpec *file);
  58. void DisposeDiskPicture(diskPicture target);
  59. diskPicture CloneDiskPicture(diskPicture source);
  60. void GetDiskPictureBounds(diskPicture source, Rect *bounds);
  61.  
  62. void InstallDiskPicture(diskPicture source);
  63. void RemoveDiskPicture(diskPicture source);
  64.  
  65. void DrawDiskPicture(diskPicture source);
  66. void GetDiskPictureInfo(diskPicture source, PictInfo *result, short verb, short requestedColors, short method);
  67.